<?php
error_reporting(0);
function create_m3u8($list) {
	foreach ($list as $key => $value) {
		$content .= "#EXTINF:\n$value\n";
	}
	return "#EXTM3U\n#EXT-X-ALLOW-CACHE:YES\n#EXT-X-TARGETDURATION:14\n" . $content . "#EXT-X-ENDLIST";
}
require 'parserVideo.class.php';
header("content-type:text/html;charset=utf-8");
header("Access-Control-Allow-Origin: *");
//header("Content-type: application/text");
//header("Content-Disposition: attachment; filename=index.m3u8");
//$url = $_POST["u"];
//$url = base64_decode($url);
$url = "http://tv.sohu.com/20151116/n426668191.shtml";
//$result = json_encode(ParserVideo::parse($url));
$a = ParserVideo::parse($url);
echo create_m3u8($a['super']);
//exit($result);